﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components {
    import flash.events.*;
    import flash.display.*;
    import net.wooga.pets.constants.*;

    public class RoofDisplay extends AbstractView {

        private var _snaparea:Sprite;

        public function RoofDisplay(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String){
            super(_arg1, _arg2, _arg3, _arg4);
            mouseEnabled = (mouseChildren = false);
            this._snaparea = this.createSnaparea();
            this._snaparea.visible = false;
            cacheAsBitmap = true;
        }
        public function initSnaparea():void{
            mouseEnabled = (mouseChildren = true);
            this._snaparea.visible = true;
            this._snaparea.addEventListener(MouseEvent.MOUSE_OVER, this.onSnapIn);
            this._snaparea.addEventListener(MouseEvent.MOUSE_OUT, this.onSnapOut);
        }
        public function removeSnaparea():void{
            mouseEnabled = (mouseChildren = false);
            this._snaparea.removeEventListener(MouseEvent.MOUSE_OVER, this.onSnapIn);
            this._snaparea.removeEventListener(MouseEvent.MOUSE_OUT, this.onSnapOut);
            this._snaparea.visible = false;
        }
        private function createSnaparea():Sprite{
            var _local1:Sprite = new Sprite();
            _local1.x = 0;
            _local1.y = 0;
            var _local2:Graphics = _local1.graphics;
            _local2.beginFill(0, 0);
            _local2.drawRect(0, 0, _asset.width, _asset.height);
            _local2.endFill();
            _asset.addChild(_local1);
            return (_local1);
        }
        private function onSnapIn(_arg1:MouseEvent):void{
            l(_arg1.type);
        }
        private function onSnapOut(_arg1:MouseEvent):void{
            l(_arg1.type);
            dispatchEvent(new Event(EventConstants.SNAP_OUT));
        }

    }
}//package net.wooga.pets.views.components 
